AGRI4401 Precision Agriculture
July 21, 2025
Presented by: University Lecturer in Precision Agriculture
Today, we’ll explore key concepts: Spatial Dependency, Moran’s I, LISA, IDW, Kriging, and Management Zones.
These form the foundation for the R tutorial on spatial interpolation and analysis.
In precision agriculture, fields aren’t uniform. Yields, soils, and nutrients vary spatially.
Understanding spatial patterns helps optimize inputs like fertilizer and water.
We’ll link theory to R code for practical mapping and zoning.
“Everything is related to everything else, but near things are more related than distant things.”
This law underpins all spatial analysis in farming.
Assumption: Spatial data shows dependency, not randomness.
Data like crop yields cluster: High yields near high yields due to soil, water, etc.
In R: We assess this with Moran’s I on yield data.
Moran’s I scores clustering from -1 to +1.
In agriculture: High Moran’s I means predictable yield zones.
Assumes spatial weights (e.g., neighbors in a grid).
In R code: We grid the yield data, compute neighbors, and run moran.test().
In our script: Scatterplot shows quadrants (HH, LL, etc.) for visualization.
Moran’s I is global; LISA is local.
Pinpoint low-yield patches for targeted management.
In R: Use localmoran() and classify clusters.
Map shows colored clusters: Red for HH, Blue for LL.
Helps farmers spot anomalies, like a fertile spot in poor soil.
Interpolation: Estimate unsampled points from known ones.
From script: Use gstat::idw() with different p values.
Advanced interpolation: Best linear unbiased predictor.
Plots semivariance vs. distance: Nugget, sill, range.
In R: variogram() and fit.variogram().
In agriculture: Universal for fields with gradients.
R code uses krige() with trend formulas.
Incorporates secondary variables (e.g., soil moisture for yield).
Script example: Zinc with distance in meuse.
graph TD
A[Start: Interpolate Spatial Data in Precision Ag] --> B{Need uncertainty estimates?};
B -- Yes --> C(Geostatistical methods);
B -- No --> D(Deterministic methods);
D --> E{Dataset size and complexity?};
E -- Small/medium, simple patterns --> F[Use IDW];
E -- Irregular points --> G[Use TIN];
C --> I{Secondary variables available?};
I -- Yes --> J[Use Co-Kriging];
I -- No --> K{Spatial trends present?};
K -- Yes --> L[Use Universal Kriging];
K -- No --> M[Use Ordinary or Block Kriging];
Divide field into uniform areas for management.
In R: paar package with kmspc() on wheat data.
These concepts ground the script: Assess dependency first, then interpolate, zone.
Run the full .qmd to see outputs.
Apply to your data for real-farm insights!
Thank you! Questions?